package com.lemon.activity;

import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

public class SecondActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_second);
    }

    public void onButtonClicked(View v) {
        switch (v.getId())
        {
            case R.id.button_push_show:
                Intent intent1 = new Intent(SecondActivity.this,ShowActivity.class);
                startActivity(intent1);
                break;
            case R.id.button_push_hide:
                Intent intent2 = new Intent("com.lemon.activity.ACTION_START");
                intent2.addCategory("com.lemon.activity.MY_CATEGORY");
                startActivity(intent2);
                break;
            case R.id.button_push_more:
                Intent intent3= new Intent(Intent.ACTION_VIEW);
                intent3.setData(Uri.parse("http://www.baidu.com"));
                startActivity(intent3);
                break;
            case R.id.button_push_dial:
                Intent intent4= new Intent(Intent.ACTION_DIAL);
                intent4.setData(Uri.parse("tel:10086"));
                startActivity(intent4);
                break;
        }
    }
}
